

async function goodCheck(ctx,next){
    try{
       ctx.verifyParams({
           name:{type:"string",required:true},
           price:{type:"string",required:true},
           num:{type:"string",required:true},
           img:{type:"string",required:true}
       })
    }catch(error){
      console.eror(error)
      return ctx.app.emit('error',{
          code:40000,
          message:error+'上传数据有误',
          rsult:''
      },ctx)
    }
    await next()
}

module.exports={goodCheck}